package cn.tedu.logistics.service;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.tedu.logistics.bean.CarType;
import cn.tedu.logistics.dao.CarTypeDao;
import cn.tedu.logistics.utils.BeanValidate;
@Service
public class CarTypeServiceImpl implements CarTypeService{
	@Autowired
	private CarTypeDao dao;
	public List<CarType> findCarType() {
		List<CarType> carType=dao.selectList(null);
		return carType;
	}

	public void addCarType(CarType carType) {
		dao.insert(carType);	
	}

	public void delCarType(Integer id) {
		dao.deleteById(id);
	}

	public CarType selectById(Integer id) {
		return dao.selectById(id);
	}

	public void updateCarType(CarType carType) {
//		if(BeanValidate.checkNull(carType)) {
//			System.out.println("存在空值");
//			return;
//		}
		dao.updateById(carType);
		
	}

}
